package space.xxhui.javatts.base.system;

import org.apache.bval.jsr.ApacheValidationProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

/**
 * @author HitvzByHui
 * date 2021-03-29
 */
@Configuration
public class WebConfig {

    // 数据验证 Validator bean
    @Bean("validator")
    public LocalValidatorFactoryBean localValidatorFactoryBean() {
        LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
        bean.setProviderClass(ApacheValidationProvider.class);
        return bean;
    }

}
